using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class AutoInsertItemMap : EntityTypeConfiguration<AutoInsertItem>
    {
        public AutoInsertItemMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.Item)
                .HasMaxLength(8);

            this.Property(t => t.Guarantor)
                .IsFixedLength()
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("AutoInsertItem");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.Item).HasColumnName("Item");
            this.Property(t => t.StartDay).HasColumnName("StartDay");
            this.Property(t => t.EndDay).HasColumnName("EndDay");
            this.Property(t => t.Guarantor).HasColumnName("Guarantor");
        }
    }
}
